﻿@{
	ViewData["Title"] = "Create";
}


<h2>@ViewData["Title"]</h2>

<p>You can upload any '.dmp' (windows full- or minidump file) or '.zip' file, containing multiple dumps.</p>

<div class="panel panel-default">
	<div class="panel-heading">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#upload" data-toggle="tab">File Upload</a></li>
			<li><a href="#local-or-web" data-toggle="tab">URL</a></li>
		</ul>
	</div>
	<div class="panel-body">
		<div class="tab-content">
			<div class="tab-pane fade in active" id="upload">
				<form onsubmit="startUpload(); return false;" enctype="multipart/form-data">
					<button class="file-upload-btn" type="button" onclick="$('.file-upload-input').trigger('click')">Add File</button>

					<div class="form-group file-upload-wrap">
						<input required type="file" name="file" class="form-control file-upload-input" onchange="readURL(this);" id="file-selector" accept=".dmp,.DMP,.zip,.ZIP" />
						<div class="drag-text">
							<h3>Drag and drop a file or select add file</h3>
						</div>
					</div>
					<div class="file-upload-content">
						<div class="file-title-wrap">
							<button type="button" onclick="removeUpload()" class="remove-file">Remove <span class="file-title">Uploaded File</span></button>
						</div>
					</div>
					<div class="form-group">
						<label for="refurl">Reference URL</label>
						<input class="form-control" type="text" placeholder="Optional reference link" name="refurl" id="refurl" />
					</div>
					<div class="form-group">
						<label for="note">Notes</label>
						<input class="form-control" type="text" placeholder="Optional notes" name="note" id="note" />
					</div>
					<button class="btn btn-default" type="submit" id="uploadBtnSubmit">
						<span class="glyphicon glyphicon-upload"></span> Go!
					</button>
					<span class="af-token">@Html.AntiForgeryToken()</span>
				</form>
			</div>
			<div class="tab-pane fade" id="local-or-web">
				@using (Html.BeginForm("Create", "Home", FormMethod.Post)) {
					<div class="form-group">
						<label for="url">URL</label>
						<input required class="form-control" type="text" id="file-upload-input" name="url" placeholder="Provide path for dump">
					</div>
					<div class="form-group">
						<label for="refurl">Reference URL</label>
						<input class="form-control" type="text" placeholder="Optional reference link" name="refurl" id="refurl" />
					</div>
					<div class="form-group">
						<label for="note">Notes</label>
						<input class="form-control" type="text" placeholder="Optional notes" name="note" id="note" />
					</div>
					<button class="btn btn-default" id="file-upload-button" type="submit">
						<span class="glyphicon glyphicon-upload"></span> Go!
					</button>
				}
			</div>
		</div>
	</div>
</div>

<!-- Modal -->
<div class="modal fade" data-keyboard="false" data-backdrop="static" id="pleaseWaitDialog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h1>Uploading...</h1>
			</div>
			<div class="modal-body">
				<div class="progress">
					<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
